/**
 * Created by sicongdu on 17-11-21.
 */
var group = require("../hackson_model").group;

const start = "<!DOCTYPE html><html><head><meta charset=\"UTF-8\">" +
    "<title>teacher</title></head><body>";

const end = "\</body></html>";

var mark = (req, res) => {
    var wherestr = {}

    var send = start;
    send += '\<form method="post" action="http://www.ourspark.org/mark_save">'


    group.find(wherestr, (err, documents) => {
        for (var i = 0; i < documents.length; i++){
            send += documents.name1;
            send += ' \<input type="checkbox" name="vote" value="'+ documents.name1 ;
            send += '">';
            send += "\<br />";
        }
    })

    send += '\<input type="submit" value="提交" />'

    send += '\</form>'

    send += end;

    res.send(send);

};

module.exports = {
    mark :mark
};
